package utils

import (
	"wit-admin-go/system/app/model"
)

// GetTree 获取菜单树
func GetTree(parentID string, data []*model.Menu) []*model.Menu {
	var tree []*model.Menu
	for _, v := range data {
		if v.ParentId == parentID {
			children := GetTree(v.Id, data)
			v.Children = children
			tree = append(tree, v)
		}
	}
	return tree
}
